package vista;

import java.awt.BorderLayout;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import clasesCreadas.JPanelImagen;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaRegistrarProducto extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	private JButton btnLimpiar;
	private JLabel lblPrecioVentaObligatorio;
	private JLabel lblStockMinimo;
	private JTextField txtStockMaximo;
	private JLabel lblStockMaximo;
	private JLabel lblStockMinimoObligatorio;
	private JTextField txtStockMinimo;
	private JLabel lblPrecioCostoObligatorio;
	private JTextField txtPrecioVenta;
	private JLabel lblPrecioVenta;
	private JTextField txtPrecioCosto;
	private JLabel lblPrecioCosto;
	private JLabel lblDescripcion;
	private JButton btnEliminar;
	private JButton btnBuscar;
	private JButton btnSalir;
	private JTextField txtCodigo;
	private JLabel lblMarcaObligatorio;
	private JTextField txtMarca;
	private JLabel lblMarca;
	private JLabel lblcodigo;
	private JLabel lblCodigoObligatorio;
	private JButton btnGuardar;
	private JScrollPane scpDescripcion;
	private JTextArea txtDescripcion;
	private JPanelImagen pnlimagen2;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaRegistrarProducto inst = new VentanaRegistrarProducto();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VentanaRegistrarProducto() {
		super(" Registrar Producto                                                            Copy David C.A J-29901186-0");
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setResizable(false);
			{
				pnlimagen2 = new JPanelImagen("pantalla.jpg");
				getContentPane().add(pnlimagen2, BorderLayout.NORTH);
				pnlimagen2.setLayout(null);
				//pnlimagen2.setBounds(10, 15, 150, 95);
				pnlimagen2.setPreferredSize(new java.awt.Dimension(701, 594));
				pnlimagen2.setBackground(new java.awt.Color(214,217,223));
				{
					btnGuardar = new VJButtonImg("","Guardar   F2");
					pnlimagen2.add(btnGuardar);
					btnGuardar.setBounds(203, 477, 93, 44);
					btnGuardar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/Guardar.png")));
				}
				{
					btnLimpiar = new VJButtonImg("","limpiar   F8");
					pnlimagen2.add(btnLimpiar);
					btnLimpiar.setBounds(320, 479, 93, 44);
					btnLimpiar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/Borrar.png")));
				}
				{
					btnSalir = new VJButtonImg("","Salir   F10");
					pnlimagen2.add(btnSalir);
					btnSalir.setBounds(559, 479, 88, 45);
					btnSalir.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/Salir.png")));
					btnSalir.setSize(93, 44);
				}
				{
					btnBuscar = new VJButtonImg("","Buscar");
					pnlimagen2.add(btnBuscar);
					btnBuscar.setBounds(503, 62, 81, 41);
					btnBuscar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/Buscar.png")));
				}
				{
					btnEliminar = new VJButtonImg("","Eliminar   F12");
					pnlimagen2.add(btnEliminar);
					btnEliminar.setBounds(444, 479, 77, 44);
					btnEliminar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/Eliminar.png")));
					btnEliminar.setSize(93, 44);
				}
				{
					lblCodigoObligatorio = new JLabel();
					pnlimagen2.add(lblCodigoObligatorio);
					lblCodigoObligatorio.setText("(*)");
					lblCodigoObligatorio.setBounds(247, 71, 16, 15);
					lblCodigoObligatorio.setForeground(new java.awt.Color(237,20,20));
				}
				{
					lblcodigo = new JLabel();
					pnlimagen2.add(lblcodigo);
					lblcodigo.setText("Codigo");
					lblcodigo.setBounds(265, 71, 47, 15);
				}
				{
					txtCodigo = new bean.JTextFieldValidator(20, bean.JTextFieldValidator.LETRAS_Y_NUMEROS);
					pnlimagen2.add(txtCodigo);
					txtCodigo.setBounds(351, 64, 140, 34);
				}
				{
					lblMarcaObligatorio = new JLabel();
					pnlimagen2.add(lblMarcaObligatorio);
					lblMarcaObligatorio.setText("(*)");
					lblMarcaObligatorio.setBounds(246, 118, 16, 15);
					lblMarcaObligatorio.setForeground(new java.awt.Color(237,20,20));
				}
				{
					lblMarca = new JLabel();
					pnlimagen2.add(lblMarca);
					lblMarca.setText("Marca");
					lblMarca.setBounds(265, 118, 38, 15);
				}
				{
					txtMarca = new JTextField();
					pnlimagen2.add(txtMarca);
					txtMarca.setBounds(351, 110, 141, 34);
				}
				{
					lblDescripcion = new JLabel();
					pnlimagen2.add(lblDescripcion);
					lblDescripcion.setText("Descripcion");
					lblDescripcion.setBounds(266, 398, 81, 15);
				}
				{
					scpDescripcion = new JScrollPane();
					pnlimagen2.add(scpDescripcion);
					scpDescripcion.setBounds(351, 372, 242, 59);
					{
						txtDescripcion = new JTextArea();
						scpDescripcion.setViewportView(txtDescripcion);
						//txtDireccion.setBounds(310, 304, 312, 55);
						//txtDireccion.setPreferredSize(new java.awt.Dimension(333, 55));
					}
				}
				{
					lblPrecioCosto = new JLabel();
					pnlimagen2.add(lblPrecioCosto);
					lblPrecioCosto.setText("Precio costo");
					lblPrecioCosto.setBounds(266, 174, 86, 15);
				}
				{
					txtPrecioCosto = new JTextField();
					pnlimagen2.add(txtPrecioCosto);
					txtPrecioCosto.setBounds(351, 163, 141, 34);
					txtPrecioCosto.addKeyListener(new KeyAdapter() {
						 public void keyTyped(KeyEvent e){
				              char carater = e.getKeyChar();
				              final String tx = txtPrecioCosto.getText().toString();
				             if((!(carater >= KeyEvent.VK_0 && carater<=KeyEvent.VK_9)) && (!(carater == KeyEvent.VK_PERIOD && tx.indexOf(".") == -1) )){
				               e.consume();
				            }
				           
				             
				             }
				            } );
				}
				{
					lblPrecioVenta = new JLabel();
					pnlimagen2.add(lblPrecioVenta);
					lblPrecioVenta.setText("Precio venta");
					lblPrecioVenta.setBounds(265, 229, 84, 15);
				}
				{
					txtPrecioVenta = new JTextField();
					pnlimagen2.add(txtPrecioVenta);
					txtPrecioVenta.setBounds(351, 219, 141, 34);
					txtPrecioVenta.addKeyListener(new KeyAdapter() {
						 public void keyTyped(KeyEvent e){
				              char carater = e.getKeyChar();
				              final String tx = txtPrecioVenta.getText().toString();
				             if((!(carater >= KeyEvent.VK_0 && carater<=KeyEvent.VK_9)) && (!(carater == KeyEvent.VK_PERIOD && tx.indexOf(".") == -1) )){
				               e.consume();
				            }
				           
				             
				             }
				            } );
				}
				{
					lblPrecioCostoObligatorio = new JLabel();
					pnlimagen2.add(lblPrecioCostoObligatorio);
					lblPrecioCostoObligatorio.setText("(*)");
					lblPrecioCostoObligatorio.setBounds(247, 174, 16, 15);
					lblPrecioCostoObligatorio.setForeground(new java.awt.Color(237,20,20));
				}
				{
					lblPrecioVentaObligatorio = new JLabel();
					pnlimagen2.add(lblPrecioVentaObligatorio);
					lblPrecioVentaObligatorio.setText("(*)");
					lblPrecioVentaObligatorio.setBounds(247, 228, 16, 15);
					lblPrecioVentaObligatorio.setForeground(new java.awt.Color(237,20,20));
				}
				{
					txtStockMinimo = new bean.JTextFieldValidator(5, bean.JTextFieldValidator.SOLO_NUMEROS);
					pnlimagen2.add(txtStockMinimo);
					txtStockMinimo.setBounds(351, 274, 141, 34);
				}
				{
					lblStockMinimo = new JLabel();
					pnlimagen2.add(lblStockMinimo);
					lblStockMinimo.setText("Stock min");
					lblStockMinimo.setBounds(265, 284, 80, 15);
				}
				{
					lblStockMinimoObligatorio = new JLabel();
					pnlimagen2.add(lblStockMinimoObligatorio);
					lblStockMinimoObligatorio.setText("(*)");
					lblStockMinimoObligatorio.setBounds(247, 283, 16, 15);
					lblStockMinimoObligatorio.setForeground(new java.awt.Color(237,20,20));
				}
				{
					lblStockMaximo = new JLabel();
					pnlimagen2.add(lblStockMaximo);
					lblStockMaximo.setText("Stock max");
					lblStockMaximo.setBounds(265, 335, 73, 15);
				}
				{
					txtStockMaximo = new bean.JTextFieldValidator(5, bean.JTextFieldValidator.SOLO_NUMEROS);
					pnlimagen2.add(txtStockMaximo);
					txtStockMaximo.setBounds(351, 326, 141, 34);
				}
			}
			pack();
			this.setSize(711, 624);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
}